package at.ac.tuwien.dse.health.security;

/**
 * This class holds the current role of the user as a thread local variable
 *
 * @author Bernhard Nickel
 * @author Gregor Schauer
 * @author Dominik Strasser
 */
public class SecurityContext {
	private static final ThreadLocal<Object> thread_role =
                           new ThreadLocal<Object>();

	/**
	 * Sets the role
	 * @param role current user role
	 */
	public static void setRole(Object role){		
		thread_role.set(role);
	}

	/**
	 * Returns the role within the current thread
	 * @return the current role
	 */
	public static Object getRole(){
		return thread_role.get();
	}
}
